package com.like.utils;

import com.like.likeutils.util.DateUtil;

import java.util.Date;

public class DateConverter {

    public static String convertShitToDate(String shit) {
        shit = shit.replace("/Date(", "").replace(")/", "");
        long timeStamp = Long.valueOf(shit.split(" ")[0]);
        return DateUtil.convert(new Date(timeStamp), "yyyy/MM/dd");
    }

    public static String convertShitToDate(String shit, String format) {
        shit = shit.replace("/Date(", "").replace(")/", "");
        long timeStamp = Long.valueOf(shit.split(" ")[0]);
        return DateUtil.convert(new Date(timeStamp), format);
    }

}
